home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3b / kill.z / kill
Encoding:
Text File  |  1998-10-20  |  5.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. KKKKIIIILLLLLLLL((((3333BBBB))))                                                              KKKKIIIILLLLLLLL((((3333BBBB))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      kill - send signal to a process (4.3BSD)
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssiiiiggggnnnnaaaallll....hhhh>>>>
  13.  
  14.      iiiinnnntttt kkkkiiiillllllll((((ppppiiiidddd____tttt ppppiiiidddd,,,, iiiinnnntttt ssssiiiigggg))));;;;
  15.  
  16.      To use any of the BSD signal routines (_k_i_l_l(3B), _k_i_l_l_p_g(3B),
  17.      _s_i_g_b_l_o_c_k(3B), _s_i_g_n_a_l(3B), _s_i_g_p_a_u_s_e(3B), _s_i_g_s_e_t_m_a_s_k(3B), _s_i_g_s_t_a_c_k(2B),
  18.      _s_i_g_v_e_c(3B)) you must either
  19.  
  20.      1) #define ____BBBBSSSSDDDD____SSSSIIIIGGGGNNNNAAAALLLLSSSS or ____BBBBSSSSDDDD____CCCCOOOOMMMMPPPPAAAATTTT before including <_s_i_g_n_a_l._h>, or
  21.  
  22.      2) specify one of them in the compile command or makefile:
  23.  
  24.           cc -D_BSD_SIGNALS -o prog prog.c
  25.  
  26.  
  27. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  28.      _k_i_l_l sends the signal _s_i_g to a process, specified by the process number
  29.      _p_i_d.  _S_i_g may be one of the signals specified in _s_i_g_v_e_c(3B), or it may be
  30.      0, in which case error checking is performed but no signal is actually
  31.      sent. This can be used to check the validity of _p_i_d.
  32.  
  33.      The sending and receiving processes must have the same effective user ID,
  34.      otherwise this call is restricted to the super-user.  A single exception
  35.      is the signal SSSSIIIIGGGGCCCCOOOONNNNTTTT, which may always be sent to any descendant of the
  36.      current process.
  37.  
  38.      If the process number is 0, the signal is sent to all processes in the
  39.      sender's process group; this is a variant of _k_i_l_l_p_g(3B).
  40.  
  41.      If the process number is -1 and the user is the super-user, the signal is
  42.      broadcast universally except to system processes.  If the process number
  43.      is -1 and the user is not the super-user, the signal is broadcast
  44.      universally to all processes with the same uid as the user.  No error is
  45.      returned if any process could be signaled.
  46.  
  47.      For compatibility with System V, if the process number is negative but
  48.      not -1, the signal is sent to all processes whose process group ID is
  49.      equal to the absolute value of the process number.  This is a variant of
  50.      _k_i_l_l_p_g(3B).
  51.  
  52.      Processes may send signals to themselves.
  53.  
  54. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  55.      Upon successful completion, a value of 0 is returned.  Otherwise, a value
  56.      of -1 is returned and _e_r_r_n_o is set to indicate the error.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. KKKKIIIILLLLLLLL((((3333BBBB))))                                                              KKKKIIIILLLLLLLL((((3333BBBB))))
  71.  
  72.  
  73.  
  74. EEEERRRRRRRROOOORRRRSSSS
  75.      _k_i_l_l will fail and no signal will be sent if any of the following occur:
  76.  
  77.      [EINVAL]       _S_i_g is not a valid signal number.
  78.  
  79.      [ESRCH]        No process can be found corresponding to that specified by
  80.                     _p_i_d.
  81.  
  82.      [ESRCH]        The process id was given as 0 but the sending process does
  83.                     not have a process group.
  84.  
  85.      [EPERM]        The sending process is not the super-user and its
  86.                     effective user ID does not match the effective user ID of
  87.                     the receiving process.
  88.  
  89. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  90.      getpid(2), getpgrp(2), killpg(3B), sigvec(3B)
  91.  
  92. CCCCAAAAVVVVEEEEAAAATTTTSSSS ((((IIIIRRRRIIIIXXXX))))
  93.      When the process number is -1, the process sending the signal is NOT
  94.      included in the delivery group.  In the IRIX implementation, the sending
  95.      process receives the signal, too.
  96.  
  97.      4.3BSD's implementation of kill returns EEEEPPPPEEEERRRRMMMM if any members of a process
  98.      group can not be signaled (when _k_i_l_l is invoked with a _p_i_d of 0).  The
  99.      IRIX implementation does not.
  100.  
  101. WWWWAAAARRRRNNNNIIIINNNNGGGG ((((IIIIRRRRIIIIXXXX))))
  102.      The 4.3BSD and System V signal facilities have different semantics.
  103.      Using both facilities in the same program is ssssttttrrrroooonnnnggggllllyyyy ddddiiiissssccccoooouuuurrrraaaaggggeeeedddd and
  104.      will result in unpredictable behavior.
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.